package aop;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

@Aspect
public class TimeProxy {
    long time =0;

    @Before("execution(void aop.Tank.*())")
    public void before(){
        this.time = System.currentTimeMillis();
        System.out.println("before");
    }

    @AfterReturning("execution (void aop.Tank.*())")
    public void after(){

        System.out.println("after:"+ (System.currentTimeMillis() - this.time));
    }
}
